package db

import (
	"gorm.io/driver/sqlite"
	"gorm.io/gorm"
)

var db1 *gorm.DB

func init() {
	var err error
	db1, err = gorm.Open(sqlite.Open("gopin.db"), &gorm.Config{})
	if err != nil {
		panic("failed to open gopin.db")
	}
	db1.AutoMigrate(&HttpEntity{})
	db1.AutoMigrate(&ApiGroup{})
	db1.AutoMigrate(&Api{})
}
